
package main;

/**
 *
 * @author Ej-Dý
 */

public enum Token {
    FOR("FOR"),
    IF("IF"),
    ELSE("ELSE"),
    VAR("VAR"),
    START("START"),
    END("END"),
    RETURN("RETURN"),
    INT("INT"),
    REAL("REAL"),
    WRITELN("PRINTLN"),
    WRITE("PRINT"),
    STRING("STRING"),
    ARRAY("ARRAY"),
    OPENREAD("OPENREAD"),
    CLOSEREAD("CLOSEREAD"),
    OPENWRITE("OPENWRITE"),
    CLOSEWRITE("CLOSEWRITE"),
    READ("READ"),
    WR("WRITE"),
    WRL("WRITELN"),
    UVOZOVKA("'"),
    TECKA("."),
    DVOJTECKA(":"),
    STREDNIK(";"),
    CARKA(","),
    PSZ("}"),
    LSZ("{"),
    PZ(")"),
    LZ("("),
    PHZ("]"),
    LHZ("["),
    VETSIROV(">="),
    MENSIROV("<="),
    NEROVNO("!="),
    MENSI("<"),
    VETSI(">"),
    ROVNO("=="),
    PRIRAZENI("="),
    KRAT("*"),
    DELENO("/"),
    MINUS("-"),
    PLUS("+"),
    COMENT,
    IDENT,
    CISLO,
    CISLOREAL,
    EOI;
    private String vyraz;

    private Token() {
    }

    private Token(String vyraz){
        this.vyraz=vyraz;
    }

    public static Token isIdent (String s){
        for(Token t: values() ){
            if(s.equalsIgnoreCase(t.vyraz)){
                return t;
            }
        }
        return IDENT;
    }
    
   
}
